package Config;

import Controller.Inerceptor.ceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurationSupport;
@Configuration
public class RersourceSacn extends WebMvcConfigurationSupport {
    @Autowired
    ceptor one;
    @Override
    protected void addResourceHandlers(ResourceHandlerRegistry registry) {
        registry.addResourceHandler("/AntTest/html/**").addResourceLocations("/AntTest/html/");
        registry.addResourceHandler("/AntTest/css/**").addResourceLocations("/AntTest/css/");
        registry.addResourceHandler("/AntTest/js/**").addResourceLocations("/AntTest/js/");
        super.addResourceHandlers(registry);
    }

    @Override
    protected void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(one).addPathPatterns("/Users","/Users/*");
    }
}
